$(function () {
    dictionaryFormValid();
});
function dictionaryFormValid() {
    $("#dictionaryForm").validate({
        rules: {
            b_dictionaryCode: {
                required: true,
                minlength: 3,
            },
            b_dictionaryName: {
                required: true,
                minlength: 3,
            },
            b_rowSort: {
                required: true,
                minlength: 1,
                isPositiveInteger: true
            }
        },
        errorPlacement: function(error, element) {
            error.appendTo(element.parent());
        },
        errorElement: "span",
        errorClass: "errortips",
        success: 'valid',
        messages: {
            b_dictionaryCode: {
                required: " (必填)",
                minlength: " (不能少于 3 个字母)",
            },
            b_dictionaryName: {
                required: " (必填)",
                minlength: " (不能少于 3 个字母)",
            },
            b_rowSort: {
                required: true,
                minlength: 1,
                isPositiveInteger: true
            }
        },
    });
}

function submitForm() {
    if($('#dictionaryForm').valid()){
        return false;
    }
    return {};
}